package com.csii.epaySandbox.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.csii.epaySandbox.entity.Case;
import com.csii.epaySandbox.service.CaseService;
import com.csii.epaySandbox.util.JsonResult;
import com.csii.epaySandbox.util.Utils;

@Controller
public class CaseController extends AbstractController {
	
	@Resource
	private CaseService caseService;
	
	@RequestMapping("/selectInterface.do")
	@ResponseBody
	public JsonResult getInterface(String deptId,String version, String bankId){
		Map paraMap = new HashMap();
		if(Utils.isEmpty(deptId) || Utils.isEmpty(version) || Utils.isEmpty(bankId)){
			
		}
		paraMap.put("deptId", deptId);
		paraMap.put("version", version);
		paraMap.put("bankId", bankId);
		List<Map> interfList = caseService.getInterface(paraMap);
		System.out.println(interfList);
		return new JsonResult(interfList);
	}
	
	@RequestMapping("/selectCase.do")
	@ResponseBody
	public JsonResult getCase(String bankId,String deptId,String interfId){
		Map paraMap = new HashMap();
		paraMap.put("interfId",interfId);
		paraMap.put("bankId", bankId);
		paraMap.put("deptId", deptId);
		List<Map> caseList = caseService.getCase(paraMap);
		return new JsonResult(caseList);
	}
	
}
